#include "lnlist.h"

int main ()
{
    #ifdef DEBUG
    ELEMTYPE i;
    #endif
    LnList list;
    POSITION p;
    
    list = createLnList();
    #ifdef DEBUG
    printf("Length of list: %d\n", lengthLnList(list));
    #endif
    #ifdef DEBUG
    for (i = 0; i < 10; i++)
    {
        appendElemLnList(list, i*100);
    } 
    #endif

    #ifdef DEBUG
    printf("Length of list: %d\n", lengthLnList(list));
    #endif
    printLnList(list);   

    appendElemLnList(list, 1);
    appendElemLnList(list, 2);
    appendElemLnList(list, 3);
    appendElemLnList(list, 4);
    appendElemLnList(list, 5);
    appendElemLnList(list, 6);
    appendElemLnList(list, 7);
    appendElemLnList(list, 8);
    
    printLnList(list);   

    #ifdef DEBUG
    printf("Length of list: %d\n", lengthLnList(list));
    #endif
    p = locateVertexLnList(list, 8);
    if (p != NULL)
    {
        printf("8 is in the lnlist!\n");
        insertPostLnList(list, p, -1);
        insertPreLnList(list, p, -1);
        printf("insert two new node before and after 8\n");
        printLnList(list);   
    }

    #ifdef DEBUG
    printf("Length of list: %d\n", lengthLnList(list));
    #endif
    destroyLnList(&list);
    printLnList(list);   

    return 0;
}
